<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>cesi</title>

    <!-- Core CSS - Include with every page -->
    <link rel=stylesheet type=text/css  href="{{ url_for('static', filename = 'css/bootstrap.min.css') }}" rel="stylesheet">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename = 'font-awesome/css/font-awesome.css') }}" rel="stylesheet">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='js/ui/jquery-ui-1.11.0.custom/jquery-ui.min.css') }}">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='js/ui/jquery-ui-1.11.0.custom/jquery-ui.css') }}">

    <!-- Page-Level Plugin CSS - Dashboard -->
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename = 'css/plugins/morris/morris-0.4.3.min.css') }}" rel="stylesheet">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename = 'css/plugins/timeline/timeline.css') }}" rel="stylesheet">

    <!-- SB Admin CSS - Include with every page -->
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename = 'css/sb-admin.css') }}" rel="stylesheet">

    <!-- Table links -->
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='custom.css') }}">
</head>

<body>

    <div id="wrapper">

        <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <div class="logo"><img src="{{ url_for('static', filename='cesi.png' ) }}" width="80" height="80"/></div>
            </div>
            <!-- /.navbar-header -->

            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="#"><i class="fa fa-user fa-fw"></i> {{username}}({{usertype}}) </a></li>
                        <li><a name="{{username}}" href="#" class="changepassword"><i class="glyphicon glyphicon-wrench"></i> Change Password </a></li>
                        {% if usertypecode == 0 %}
                        <li class="divider"></li>
                        <li><a href="#" class="adduser"><i class="glyphicon glyphicon-plus"></i> Add User </a></li>
                        <li><a class="deluser"><i class="glyphicon glyphicon-trash"></i> Delete User </a></li>
                        {% endif %}
                        <li class="divider"></li>
                        <li><a href="/logout"><i class="fa fa-sign-out fa-fw"></i> Logout</a></li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
            <!-- /.navbar-top-links -->

            <div class="navbar-default navbar-static-side" role="navigation">
                <div class="sidebar-collapse">
                    <ul class="nav" id="side-menu">
                        <!-- Navbar Dashboard -->
                        <li>
                            <a href="/" class="dashboard"><i class="glyphicon glyphicon-dashboard"></i> Dashboard</a>
                        </li>

                        <!--Navbar showall-->
                        <li>
                            <a href="#" class="showall" usertype="{{usertypecode}}"><i class="glyphicon glyphicon-list"></i> Show All</a>
                        </li>

                        <!--Navbar Nodes-->
                        <li>
                            <a href="#"><i class="glyphicon glyphicon-th-list"></i> Nodes<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                {% for node_name in connected_node_list %}
                                    <li class="ajax2" value="{{node_name}}" usertype="{{usertypecode}}">
                                        <a> <input type="checkbox" class="ajax" value="{{ node_name  }}" disabled="true"> {{ node_name  }} </a>
                                    </li>
                                {% endfor %}
                                {% for node_name in not_connected_node_list %}
                                    <li value="{{node_name}}" >
                                        <a><i class="glyphicon glyphicon-remove"></i> {{ node_name  }} </a>
                                    </li>
                                {% endfor %}
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>

                        <!--Navbar Environments-->
                        <li>
                            <a><i class="glyphicon glyphicon-th-large"></i> Environments<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <!--Environment names-->
                            {% for memberlist in environment_list %}
                                <li>
                                   <a><i class="glyphicon glyphicon-tag"></i> {{ environment_name_list[ loop.index-1 ] }}<span class="fa arrow"></span></a>
                                   <ul class="nav nav-third-level">
                                    <!--Environment's node names-->
                                    {% for member in memberlist %}
                                        <li class="ajax2" value="member {{member}}" usertype="{{usertypecode}}">
                                            <a><input type="checkbox" value="{{ member }}" disabled="true"> {{ member }}</a>
                                        </li>
                                    {% endfor %}
                                   </ul>
                                </li>
                            {% endfor %}
                            </ul>
                            <!-- /.nav-second-level -->

                        </li>

                        <!--Navbar groups-->
                        <li>
                            <a href="#" class="groups"><i class="glyphicon glyphicon-th"></i> Groups <span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                            {% for index in range(group_list|length) %}
                                <li>
                                    <a><i class="glyphicon glyphicon-paperclip"></i> {{ group_list[index] }} <span class="fa arrow"> </a>
                                        <ul class="nav nav-third-level">
                                        {% for env_name in g_environment_list[index] %}
                                            <li class="ajax3" usertype="{{usertypecode}}">
                                                <a><input type="checkbox" group="{{ group_list[index] }}" env="{{ env_name }}"  disabled="true"> {{ env_name }} </a>
                                            </li>
                                        {% endfor %}
                                        </ul>
                                </li>
                            {% endfor %}
                            </ul>
                        </li>
                    </ul>
                    <!-- /#side-menu -->
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12 pagewrap" id="maindiv">
                    <div class="dash">
                        <div class="row">
                            <div class="col-lg-4 col-xs-4">
                                <div class="small-box bg-teal">
                                    <div class="inner">
                                        <h3>Environment</h3>
                                        <h4> Node Count </h4>
                                        <h3>{{node_count}}</h3>
                                        <h4>Process Count</h4>
                                        <h3>{{all_process_count}}</h3>
                                        <br/><br/><br/><br/>
                                    </div>
                                </div>
                            </div><!-- ./col -->
                            <div class="col-lg-4 col-xs-4">
                                <div class="small-box bg-blue">
                                    <div class="inner">
                                        <h3>Nodes</h3>
                                        <h4> Node Count </h4>
                                        <h3>{{node_count}}</h3>
                                        <h4>Connected</h4>
                                        <h3>{{connected_count}}</h3>
                                        <h4>Not Connected</h4>
                                        <h3>{{not_connected_count}}</h3<br/>
                                    </div>
                                </div>
                            </div><!-- ./col -->
                            <div class="col-lg-4 col-xs-4">
                                <!-- small box -->
                                <div class="small-box bg-navy">
                                    <div class="inner">
                                        <h3>Process</h3>
                                        <h4> Process Count </h4>
                                        <h3>{{all_process_count}}</h3>
                                        <h4>Running</h4>
                                        <h3>{{running_process_count}}</h3>
                                        <h4>Stopped</h4>
                                        <h3>{{stopped_process_count}}</h3>
                                    </div>
                                </div>
                            </div><!-- ./col -->
                        </div><!-- /.row -->
                    </div> <!--Dashboard-->
        
                    <div class="panel panel-custom activity-log bg-black" ><div class="panel-heading bg-yellow">Activity log</div><p></p></div>            

                </div>
                <!-- End collg-12 maindiv -->
                </div>
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->
    </div>
    <!-- /#wrapper -->
        <div id="dialog">
        </div>
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename='jquery.min.js') }}"></script>
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename='js/ui/jquery-ui-1.11.0.custom/jquery-ui.js') }}"></script>
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename='js/ui/jquery-ui-1.11.0.custom/jquery-ui.min.js') }}"></script>
    <!-- Core Scripts - Include with every page -->
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename='custom.js') }}"></script>
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename ='js/bootstrap.min.js') }}"></script>
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename ='js/plugins/metisMenu/jquery.metisMenu.js') }}"></script>

    <!-- Page-Level Plugin Scripts - Dashboard -->
    <script language="JavaScript" type="text/javascript"  src="{{ url_for('static', filename ='js/plugins/morris/raphael-2.1.0.min.js') }}"></script>
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename ='js/plugins/morris/morris.js') }}"></script>

    <!-- SB Admin Scripts - Include with every page -->
    <script language="JavaScript" type="text/javascript" src="{{ url_for('static', filename ='js/sb-admin.js') }}"></script>

    <!-- Page-Level Demo Scripts - Dashboard - Use for reference -->
    <script language="JavaScript" type="text/javascript"  src="{{ url_for('static', filename ='js/demo/dashboard-demo.js') }}"></script>
    <script language="JavaScript" type="text/javascript"  src="{{ url_for('static', filename ='noty-2.2.4/js/noty/packaged/jquery.noty.packaged.min.js') }}"></script>
</body>

</html>
